<?php 
include "includes/session.php";
include "includes/comunes.php";
require_once("includes/paginator.class.php");
$pages = new Paginator;

$sql="select * from personas where personaId=".$_GET['cli_id'];
//armo el Where de la consutla
$resper=cons_sql_up($sql);
$regPer=mysql_fetch_array($resper);
 
 
$sqlDet="select distinct (detalleBoleto) as detalleBoleto, detalleCliente,detalleTasa  from detallecuotas where detalleCliente=".$_GET['cli_id']." order by detalleBoleto desc ";
//echo $sqlDet;die();

//realizo la consulta paro obtener los totales

$result= cons_sql_up($sql);
//finc consulta

$pages->items_total = mysql_num_rows($result);
$pages->mid_range = 9;
$pages->paginate();
$result= cons_sql_up($sqlDet.$pages->limit);
//echo $sqlDet.$pages->limit;die();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta HTTP-EQUIV="refresh" CONTENT="300"/>
<title>Sistema de Gestion de Vehiculos</title>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="estilos.css" rel="stylesheet" type="text/css" />

<!--libreria jquery central-->

<script src="jquery-ui/js/jquery-1.9.1.js"></script>
<!--fin libreria central-->

<!--Librerias para el combo-->
<script language="JavaScript" type="text/javascript" src="combos/jquery.chainedSelects.js"></script>
<!--fin libreria-->

<!--librerias ui-->
<link href="jquery-ui/css/ui-lightness/jquery-ui-1.10.2.custom.css" rel="stylesheet"/>
<script src="jquery-ui/js/jquery-ui-1.10.2.custom.js"></script>
<!--fin libreria-->
<!--libreria flexigrid-->
<link rel="stylesheet" type="text/css" href="jquery-ui/css/ui-flexigrid/flexigrid.css">
    <script type="text/javascript" src="jquery-ui/js/flexigrid.js"></script>
<!--fin libreria-->



<script language="JavaScript" type="text/javascript">
$(function()
{

//        funcion que implementa combos




  $('#flex1').flexigrid({
      colModel : [
                
		{display: 'Boleto', name : 'accionistaId', width : 90,sortable : true, align: 'center'},
		{display: 'Vehiculo', name : 'accionistaId', width : 100,sortable : true, align: 'center'},
		{display: 'Tasa Mensual', name : 'dni', width : 100, sortable : true, align: 'left'},
		{display: 'Cant. Cuotas', name : 'nomyape', width : 60, sortable : true, align: 'left'},
		{display: 'Fecha Operacion', name : 'fecha', width : 100, sortable : true, align: 'left'},
		{display: 'Deuda', name : 'fecha', width : 100, sortable : true, align: 'left'},
		{display: 'Acciones', name : 'acciones', width : 105, sortable : false, align: 'left'}
		],
                width: 480,
                height: 1000
              
  });
<?php for ($i=1;$i<30;$i++):?>
  $('#fila<?php echo $i?>').tooltip({
      track: true
    });
 
<?php endfor?>
<?php for ($i=1;$i<30;$i++):?>
  $('#visualizar<?php echo $i?>').tooltip({
      track: true
    });

<?php endfor?>
 <?php for ($i=1;$i<30;$i++):?>
  $('#editar<?php echo $i?>').tooltip({
      track: true
    });

<?php endfor?>
<?php for ($i=1;$i<30;$i++):?>
  $('#imprimir<?php echo $i?>').tooltip({
      track: true
    });

<?php endfor?>
<?php for ($i=1;$i<30;$i++):?>
  $('#tratar<?php echo $i?>').tooltip({
      track: true
    });

<?php endfor?>
});
</script>



</head>

<body>

<div class="container">
<?php include "includes/head.php"?>
   <div class="content">
       <div class="tituloprincipal">
           <?php include 'includes/submenu.php';?>  
           <img src="img/pedidos.jpg" width="25" height="25" border="0"/> Listado de Creditos de <?php echo strtoupper($regPer['personaNombre'])?></div>
       
       <div class="contenedorpedido">
       
           <fieldset>
             <legend><b>Detalle de Creditos</b></legend>
           
             </br>

             <table id="flex1" >

               <tbody>

                <?php
                $i=1;
                if($pages->items_total >0)
                while($reg= mysql_fetch_array($result)):
				
				//busco el ID del vehiculo para mostrar la descripcion del mismo
				$tabla="boletoventa";
				$condicion=" boletoId=".$reg['detalleBoleto'];
				$orden=" order by boletoId desc";
				$result1=  cons_sql($tabla, $condicion, $orden);
				$regveh1=mysql_fetch_array($result1);
				//fin
				
				
				?>
                  <tr id="fila<?php echo $i?>">
                     
                     <td><?php echo $reg['detalleBoleto']?></td>
					 <td><?php echo obtener_desc_vehiculo($regveh1['boletoVehiculo'])?></td>
                     <td ><?php echo $reg['detalleTasa']?></td>
                     <td ><?php echo obtener_can_cuotas($reg['detalleBoleto'])?></td>
                     <td > <?php echo fecha_boleto($reg['detalleBoleto'])?></td>
                     <td >$ <?php echo credito_deuda($reg['detalleBoleto'])?></td>
     
                     <td>
                     <a href="ListarCuotas.php?bol_id=<?php echo $reg['detalleBoleto']?>&cli_id=<?php echo $regPer['personaId']?>&tasa=<?php echo $reg['detalleTasa']?>&cuotas=<?php echo obtener_can_cuotas($reg['detalleBoleto'])?>&total=<?php echo credito_deuda($reg['detalleBoleto'])?>" ><img src="img/detallecuotas.jpg" border="0" width="25px" id="visualizar<?php echo $i?>" title="Ver Detalle de cuotas"></a>
                  
                  </tr>
                 <?php
                 $i++;
                 endwhile
                
                 ?>

                   <tr>
                       <td colspan="8"><?php echo $pages->display_jump_menu();echo $pages->display_items_per_page();echo $pages->display_pages() ?></td>
                   </tr>
                </tbody>

             </table>
             

        </fieldset>
           
       </div>
 
       <div class="clear"></div>
   <br>
   </div>
  <?php include "includes/pie.php"?>
  
</div>
</body>
</html>
